﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;


public class MainMenuPanel : BasePanel {
    private CanvasGroup canvasGroup;

    void Start()
    {
        canvasGroup = GetComponent<CanvasGroup>();

    }

    public override void OnPause()
    {
        canvasGroup.blocksRaycasts = false;//当弹出新的面板时，让主菜单面板不在和鼠标交互
        
    }
    public override void OnResume()
    {
        canvasGroup.blocksRaycasts = true;
    }
    public void OnPushPanel(string panelTypeString)
    {
        //将字符串类型转换为枚举类型
        UIPanelType panelType = (UIPanelType)System.Enum.Parse(typeof(UIPanelType), panelTypeString);
        //实例化预制体
        UIManager.Instance.PushPanel(panelType);

    }
}
